package org.demis.dwarf.core.db;

import java.util.ArrayList;
import java.util.List;

public class PrimaryKey extends ColumnReferencesHolder {

    private String name = null;

    private List<ColumnReference> referencedColumns = new ArrayList<ColumnReference>();

    private Table table = null;

    public PrimaryKey() {
        // no op
    }

    public PrimaryKey(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Table getTable() {
        return table;
    }

    public void setTable(Table table) {
        if (this.table != table) {
            this.table = table;
            table.setPrimaryKey(this);
        }
    }
}
